<template>
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
        @pagination="getList" />
</template>

<script>
export default {
    name: "RecordPagination",
    props: {
        // 总条数
        total: {
            type: Number,
            default: 0
        },
        // 查询参数
        queryParams: {
            type: Object,
            default: () => {
                return {
                    pageNum: 1,
                    pageSize: 10
                };
            }
        }
    },
    methods: {
        /** 查询按钮操作 */
        getList() {
            this.$emit('query', this.queryParams);
        }
    }
};
</script>

<style lang="scss" scoped>
.record-pagination {
    margin-top: 20px;
    text-align: right;
}
</style>